# 多模态数据采集脚本

class DataGenerator:
    def __init__(self, env_builder):
        self.env = env_builder
        self.current_episode = 0

    def generate_episode(self, scene_name, max_steps=200):
        """生成单条轨迹数据"""
        self.env.reset_scene(scene_name)
        metadata =

        for step in range(max_steps):
            frame_data = self._capture_frame(step)
            action = self._select_action()
            self.env.controller.step(action)
            metadata.append(frame_data)

        self._save_episode(metadata)

    def _capture_frame(self, step):
        """捕获单帧多模态数据"""
        event = self.env.controller.last_event
        return {
            'rgb': event.frame,
            'depth': event.depth_frame,
            'pose': event.metadata['agent']['position'],
            'timestamp': time.time_ns()
        }

    def _select_action(self):
        """基于epsilon-greedy策略选择动作"""
        if random.random() < 0.3:
            return random.choice(["MoveAhead", "RotateRight", "RotateLeft"])
        else:
            return self._path_finding_action()